package service

import (
	"go-admin/src/dao"
	"go-admin/src/model"
)

func Register(username,email,password,ip string) int{

	user:= model.User{
		Username: username,
		Email: email,
		Password: password,
		UserExtra: model.UserExtra{
			NickName: username,
			IP: ip,
		},
	}
	ID,err:= dao.UserInsert(&user)
	if err!=nil{
		return 0
	}
	return  ID
}
